import { getToken, removeToken, setToken } from '@/utils/storage'
export default {
  namespaced: true,
  state: {
    token: getToken()
  },

  mutations: {
    setUserToken (state, payload) {
      // 设置本地存储
      setToken(payload)
      // 传输的token
      state.token = payload
    },
    delUserToken (state) {
      removeToken()
      state.token = null
    }
  }
}
